﻿<UserControl x:Class="WPFCommonControl.SqlServerLoginControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Self="clr-namespace:WPFCommonControl">
    <UserControl.CommandBindings>
            <CommandBinding Command="Self:ControlCommands.GetTableListCmd" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed"/>
    </UserControl.CommandBindings>
    <Grid Margin="5">
        <StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 2 " x:Name="paneServername">
                <Label  Width="120" HorizontalContentAlignment="Right">Server ip(name)</Label>
                <ComboBox  x:Name="cmbServername" Width="200" Margin="5 0 0 0" IsEditable="True" IsReadOnly="False" />
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 2 " x:Name="panelUsername">
                <Label  HorizontalContentAlignment="Right" Width="120" >username</Label>
                <TextBox  Name="txtUsername" Width="200"  Margin="5 0 0 0"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 2 " x:Name="panelPassword">
                <Label  Width="120" HorizontalContentAlignment="Right">password</Label>
                <PasswordBox x:Name="passwordBox1" Width="200" LostFocus="passwordBox1_LostFocus"  Margin="5 0 0 0"/>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 2 " x:Name="panelDatabase">
                <Label HorizontalContentAlignment="Right" Width="120">database name</Label>
                <ComboBox Width="200" x:Name="cmbDbName" IsEditable="True" Text=""  Margin="5 0 0 0"/>
                <Button x:Name="butEmulatorDbList"
                Command="Self:ControlCommands.GetTableListCmd"
                Width="26">
                    <Button.Content>
                        <Path StrokeThickness="1.500000" Stroke="#ffffffff" StrokeMiterLimit="1.000000" 
              Fill="Blue"
              Data="F1 M 9.816406,1.694336 L 12.351074,6.830078 L 18.018066,7.654297 L 13.918457,11.654297 L 14.886230,17.299805 L 9.816406,14.630859 L 4.746094,17.299805 L 5.713867,11.654297 L 1.611328,7.654297 L 7.281250,6.830078 L 9.816406,1.694336 Z" 
              HorizontalAlignment="Left" VerticalAlignment="Center" x:Name="Star"/>
                    </Button.Content>
                    <Button.ToolTip>
                        <StackPanel>
                            <TextBlock Text="Recommend you click this button to emulator the table list of current database"/>
                        </StackPanel>
                    </Button.ToolTip>
                </Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 2 " x:Name="panelDatabaseFile" Visibility="Collapsed">
                <Label  HorizontalContentAlignment="Right" Width="120" Content="Database File"/>
                <TextBox x:Name="txtDbFileLocation" Width="200" />
                <Button x:Name="butSelectFile" Content=" ... " Click="butSelectFile_Click" />
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 2 ">
                <Label  HorizontalContentAlignment="Right" Width="120">Connect Type</Label>
                <ComboBox  x:Name="cmbConnMode" Width="200" SelectionChanged="cmbConnMode_SelectionChanged"  Margin="5 0 0 0" />
            </StackPanel>
            <StackPanel Orientation="Horizontal" Margin="0 2 ">
                <Label HorizontalContentAlignment="Right" Width="120" >Port</Label>
                <TextBox Width="200" x:Name="txtPort"  Margin="5 0 0 0">1433</TextBox>
            </StackPanel>
            <CheckBox  IsChecked="False" x:Name="chkIsTrustedConn"
                       Margin="0 2 " HorizontalAlignment="Center">Is Trusted Connection</CheckBox>

            </StackPanel>
     


    </Grid>
</UserControl>
